//package name.wilbur.course.db.bigone.service.impl;
//
//import java.io.File;
//import java.io.FileInputStream;
//import java.io.FileOutputStream;
//import java.io.IOException;
//import java.io.InputStream;
//import java.io.OutputStream;
//
//import name.wilbur.course.db.bigone.service.IFileService;
//
//public class FileService implements IFileService {
//	public FileService() {
//	}
//	
//	public void upload(File file, String fileName, String uploadDir) throws IOException {
//		InputStream is = new FileInputStream(file);
//		String path = ServletActionContext.getServletContext().getRealPath(uploadDir);
//		File toFile = new File(path, fileName);
//		OutputStream os = new FileOutputStream(toFile);
//		byte[] buffer = new byte[1024];
//		int len = 0;
//		while ((len = is.read(buffer)) > 0) {
//			os.write(buffer, 0, len);
//		}
//		is.close();
//		os.close();
//	}
//}
